package com.stockz.ui.swing.charting.view;

import java.awt.ComponentOrientation;
import java.awt.FlowLayout;
import java.net.URLDecoder;
import java.util.List;

import javax.swing.JPanel;

import com.stockz.core.model.Scrip;
import com.stockz.ui.swing.charting.widget.toolbar.DrawingToolBar;
import com.stockz.ui.swing.charting.widget.toolbar.IndicatorToolBar;
import com.stockz.ui.swing.charting.widget.toolbar.NavigationToolbar;
import com.stockz.ui.swing.charting.widget.toolbar.ViewToolbar;
import com.stockz.ui.swing.widget.WrapLayout;

public class StockChartControlPanel extends JPanel {
	private static final long serialVersionUID = 8522128625921557855L;

	@SuppressWarnings("unused")
	private final StockChartView stockChartView;
	private final NavigationToolbar navigationToolbar;
	private final ViewToolbar viewToolbar;
	private final DrawingToolBar drawingToolBar;
	private final IndicatorToolBar indicatorToolBar;
	
	public StockChartControlPanel(StockChartView stockChartView, List<Scrip> scripList) {
		this.stockChartView = stockChartView;
		
		navigationToolbar = new NavigationToolbar(stockChartView.getStockChartPanel(),scripList);
		viewToolbar = new ViewToolbar(stockChartView.getStockChartPanel());
		drawingToolBar = new DrawingToolBar(stockChartView.getStockChartPanel());
		indicatorToolBar = new IndicatorToolBar(stockChartView.getStockChartPanel());
		
		setComponentOrientation(ComponentOrientation.LEFT_TO_RIGHT);
		//setLayout(new FlowLayout(FlowLayout.LEFT));
		setLayout(new WrapLayout(FlowLayout.LEFT));
		add(navigationToolbar);
		add(viewToolbar);
		add(drawingToolBar);
		add(indicatorToolBar);
	}
	
	
	
	
	@SuppressWarnings("deprecation")
	public static void main(String args[]){
		String path = "http://audio4.hark.com/production/audio/000/372/812/372812.mp3?Expires=1352614094&amp;Signature=k9snFPkIIH1J-YX-MIP2UNbxqvY7MdfO4gv7p0SNaCCBhR8vZwJl8VmwP8u%7EcjH5cRLTyTkT%7EgMEhatHCSnkOFtK02pVhoV3wyvGq9GqojcQqYI4mBA4p-fzxYeayWO7Poy9VWpTe2iWwaA3utW8Mhi1-gqJIXYy52wYDCc5JaE_&amp;Key-Pair-Id=APKAJ4OMVLWQ4ZNQYIKQ";
		System.out.println(URLDecoder.decode(path));
	}
	
	
	
}
